CC=clang++
antlrI=-I/usr/local/include/antlr4-runtime
llvmI=-I/usr/lib/llvm-10/include
antlrl=-lantlr4-runtime
llvml=-lLLVM-10
antlr4=java -Xmx500M -cp "/usr/local/lib/antlr-4.9-complete.jar:$CLASSPATH" org.antlr.v4.Tool

grammar:
	$(antlr4) calculator.g4
	javac *.java
visitor:
	$(antlr4) calculator.g4 -Dlanguage=Cpp -visitor -no-listener
main:
	$(CC) *.cpp $(antlrI) $(llvmI) $(antlrl) $(llvml)   -o main  -std=c++17 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACRO
clean:
	rm *.tokens *.interp
	rm calculator*.cpp calculator*.h
	rm main
